package com.lagou.edu.factory;

import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * 单例bean
 */
@Component
//@Lazy(value = true)
@Lazy(value = false)
@Scope(value = "singleton")
public class ScopeOfSingletonBean {

    @PostConstruct
    public void init() {
        System.out.println("ScopeOfSingletonBean 初始化方法.....");
    }

    @PreDestroy
    public void destory() {
        System.out.println("ScopeOfSingletonBean 销毁方法......");
    }
}
